/*
 * Copyright (C) 2025 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef FRAMEWORKS_KITS_TAIHE_INCLUDE_AUXILIARY_PICTURE_TAIHE_H
#define FRAMEWORKS_KITS_TAIHE_INCLUDE_AUXILIARY_PICTURE_TAIHE_H

#include "auxiliary_picture.h"
#include "ohos.multimedia.image.image.proj.hpp"
#include "ohos.multimedia.image.image.impl.hpp"

namespace ANI::Image {
using namespace taihe;
using namespace ohos::multimedia::image::image;

class AuxiliaryPictureImpl {
public:
    AuxiliaryPictureImpl();
    explicit AuxiliaryPictureImpl(std::shared_ptr<OHOS::Media::AuxiliaryPicture> auxiliaryPicture);
    ~AuxiliaryPictureImpl();
    int64_t GetImplPtr();
    std::shared_ptr<OHOS::Media::AuxiliaryPicture> GetNativeAuxiliaryPic()
    {
        return nativeAuxiliaryPicture_;
    }
    
    void WritePixelsFromBufferSync(array_view<uint8_t> data);
    optional<array<uint8_t>> ReadPixelsToBufferSync();
    optional<AuxiliaryPictureType> GetType();
    void SetMetadataSync(MetadataType metadataType, weak::Metadata metadata);
    optional<Metadata> GetMetadataSync(MetadataType metadataType);
    optional<AuxiliaryPictureInfo> GetAuxiliaryPictureInfo();
    void SetAuxiliaryPictureInfo(AuxiliaryPictureInfo const& info);
    void Release();
    
private:
    std::shared_ptr<OHOS::Media::AuxiliaryPicture> nativeAuxiliaryPicture_;
    bool isRelease = false;
};
} // namespace ANI::Image

#endif // FRAMEWORKS_KITS_TAIHE_INCLUDE_AUXILIARY_PICTURE_TAIHE_H